package visualcbir;
import java.awt.Dimension;
import java.awt.Point;
import java.util.Observer;
import visualcbir.node.IViewNode;
/**
 *
 * @author sheila
 */
public abstract class View implements Observer {
    protected Model oModel;    
    protected IBackStructureView oIBackStructureView;//sh// somente para ViewComposed
    
    //******************** VIEW OBJECTS **************************************//
    private Dimension dimView;
    private Point centerPoint;
    private double scaleFactor=1;
    //protected INodeView oNodePick;
    //sh//protected boolean isChanged=true;
    //private double zoomScale=1.0;
    
   
    public View(Model poModel){
        this.dimView = new Dimension();
        this.centerPoint=new Point();
        this.oModel=poModel;
        this.oModel.registerView(this);
    }

    public Model getModel() {    return oModel;    }
    public double getScaleFactor() {     return this.scaleFactor;    }
    public void setScaleFactor(double pScaleFactor) {  this.scaleFactor = pScaleFactor;  }
    public void clearView(){    }
    public abstract void drawViewFactory(Object pArg);
    public abstract IViewNode getCenterNode();
    //sh//    public Color getColor() {    return vcolor;   }
//    public void setColor(Color pvColor) {    this.vcolor = pvColor;    }

    //**  Factory & Abstract Factory Pattern Functions **//
    public abstract IBackStructureView makeBackStructureView();
    public abstract void makeViewFactory();

    //** Get and Set Functions **
    public abstract Dimension computeViewDimension();
    public Dimension getViewDimension(){    return this.dimView;   } 
    public void setViewDimension(int viewWidth, int viewHeight){  this.dimView.setSize(viewWidth, viewHeight);   }
    public Point getCenterPoint() {     return centerPoint;   }
    public void setCenterPoint(int x, int y) {  this.centerPoint.move(x, y);   }
    //sh//public void setCenterPoint(double x, double y) {  this.centerPoint.setLocation(x, y);   }
    
    //sh//public double getZoomScale() {     return zoomScale;   }
    //sh//public void setZoomScale(double zoomScale) { this.zoomScale = zoomScale;  }

    //public abstract NodeView getCenterNode();
    //public abstract void drawBackStructure(Graphics g);
}